package com.gxa.autoparts.core.util;

import java.net.InetAddress;
import java.net.UnknownHostException;

public class IpUtil {

    public static String getIp() throws UnknownHostException {
        InetAddress addr = InetAddress.getLocalHost();
        System.out.println("Local HostAddress: "+addr.getHostAddress());
        String hostname = addr.getHostName();
        System.out.println("Local host name: "+hostname);
        return addr.getHostAddress();
    }
}